<template>
  <div>
    <top-label v-model="index">
      <span :slot="0">预警统计趋势</span>
      <span :slot="1">隐患统计趋势</span>
      <span :slot="2">事故事件统计趋势</span>
    </top-label>
    <el-row>
      <warning-statistical-trend v-if="index === 0"></warning-statistical-trend>
      <hidden-danger-trend v-if="index === 1"></hidden-danger-trend>
      <accidents-trend v-if="index === 2"></accidents-trend>
    </el-row>
  </div>
</template>

<script>
import WarningStatisticalTrend from "./risk-dynamic-judgement-body/WarningStatisticalTrend";
import HiddenDangerTrend from "./risk-dynamic-judgement-body/HiddenDangerTrend";
import AccidentsTrend from "./risk-dynamic-judgement-body/AccidentsTrend";
import TopLabel from "../../components/TopLabel";
export default {
  name: "MonitorManagement",
  components: {
    WarningStatisticalTrend,
    HiddenDangerTrend,
    AccidentsTrend,
    TopLabel,
  },
  data() {
    return {
      index: 0,
    };
  },
  created() {
    if (window.sessionStorage.getItem("indexsu1") != null) {
      this.index = Number(window.sessionStorage.getItem("indexsu1"));
    }
  },
  watch: {
    index: function (indexra, oldVal) {
      window.sessionStorage.setItem("indexsu1", indexra);
      // console.log(val);
    },
  },
};
</script>

<style scoped>
.row {
  margin-left: 0.075rem;
}
</style>